]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appDisplay: Ensure icons always are at the correct position
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Tue, 23 Jun 2020 15:18:56 +0000 (12:18 -0300)
committerFlorian Müllner <florian.muellner@gmail.com>
Mon, 20 Jul 2020 16:13:20 +0000 (16:13 +0000)
When redisplaying, we currently only remove and add icons, but
never adjust the position of already added icons. If the icon
position changed, it wouldn't be reflected on the icon grid.

Make sure to move already added icons.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284

js/ui/appDisplay.js

index eb9f228cacad7e53de5c6706b9e1207f03bb3c51..546d509b04c81b33445f7c28f6cba4b62ae301f5 100644 (file)
@@ -333,10 +333,13 @@ var BaseAppView = GObject.registerClass({
             icon.destroy();
         });
 
-        // Add new app icons
-        addedApps.forEach(icon => {
-            const [page, position] = this._getItemPosition(icon, newApps);
-            this._addItem(icon, page, position);
+        // Add new app icons, or move existing ones
+        newApps.forEach(icon => {
+            const [page, position] = this._getItemPosition(icon);
+            if (addedApps.includes(icon))
+                this._addItem(icon, page, position);
+            else if (page !== -1 && position !== -1)
+                this._moveItem(icon, page, position);
         });
 
         this._viewIsReady = true;